package com.csscis.ssm.web.service.impl;

import com.csscis.ssm.core.feature.orm.mybatis.Page;
import com.csscis.ssm.core.generic.GenericDao;
import com.csscis.ssm.core.generic.GenericServiceImpl;
import com.csscis.ssm.web.dao.PhoneUserMapper;
import com.csscis.ssm.web.model.PhoneUser;
import com.csscis.ssm.web.service.PhoneUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.UUID;

@Service
public class PhoneUserServiceImpl extends GenericServiceImpl<PhoneUser, Long> implements PhoneUserService {


    @Resource
    private PhoneUserMapper phoneUserMapper;

    @Override
    public GenericDao<PhoneUser, Long> getDao() {

        return phoneUserMapper;
    }

    @Override
    public int insert(PhoneUser phoneUser, HttpServletRequest request) {

        phoneUser.setPuserId(UUID.randomUUID().toString());
        return super.insert(phoneUser);
    }
/*    @Override
    public List<PhoneUser> selectAndPage(Page<PhoneUser> page, PhoneUser model){
        return getDao().selectAndPage(page, model);
    }*/

    /**
     * 查询全部印刷厂
     * @return
     */
    @Override
    public List<PhoneUser> queryAllPhoneUser() {

        return phoneUserMapper.queryAllPhoneUser();
    }
}
